package com.baoteng.network.model;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;

public class NetworkConstants {
    private NetworkConstants() throws Exception {
        throw new Exception();
    }

    public static boolean NEED_TOKEN = true;
    public static boolean HAVE_UNIQUE_TOKEN_URL = false;//是否有定义单独获取token的接口
    public static final String LOG_NAME = "BtHttp";
    public static final Level LOG_LEVEL = Level.INFO;
    public static final String CLIENT_PASSWORD = "XiaoMaLiXing001";
    public static final String TOKEN_URL = "token_url";
    //不需要验证token的接口，在TokenManager.withoutToken中过滤
    public static List<String> WITHOUT_TOKEN_URLS = new ArrayList<>();
    //前缀
    public static final String PRE_URL = "http://dcop_test.powerleadercdn.com/index.php/api";
    public static final int RETRY_COUNT = 3; //默认请求次数

    static {
        //添加不需token验证的接口（最好需要完整的http地址）
        WITHOUT_TOKEN_URLS.add(TOKEN_URL);
        WITHOUT_TOKEN_URLS.add("index.php/api/login");
        WITHOUT_TOKEN_URLS.add("index.php/api/checkUserIdentity");
    }
}

